package progress.exa5;

import java.io.FileReader;
import java.io.IOException;

/**
 * 文件字符输入流
 */
public class FileReaderStudy {
    public static void main(String[] args) throws IOException {
        fileReaderStudy();
    }

    /**
     * 文件字符输入流
     * @throws IOException
     */
    public static void fileReaderStudy() throws IOException {
        FileReader fileReader = null;
        try {
            fileReader = new FileReader("麻子.txt");
            int n;
            while ((n= fileReader.read())!=-1) {
                System.out.print((char)n);
            }
        }catch (Exception e) {
            e.printStackTrace();
        }finally {
            if(fileReader!=null) {
                fileReader.close();
            }
        }
    }

}
